package it.koutifaris.travianmap.ui.touch;

import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.View.OnTouchListener;

public class MapViewOnTouchListener implements OnTouchListener {

	private final GestureDetector gestureDetector;
	private final ScaleGestureDetector scaleDetector;

	public MapViewOnTouchListener(GestureDetector gestureDetector, ScaleGestureDetector scaleDetector) {
		this.gestureDetector = gestureDetector;
		this.scaleDetector = scaleDetector;
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		gestureDetector.onTouchEvent(event);
		scaleDetector.onTouchEvent(event);

		return true;
	}

}
